package meconsea.webcoll.sys.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import meconsea.webcoll.base.entity.AbsEntity;
import meconsea.webcoll.base.entity.IEntity;

@SuppressWarnings("serial")
@Entity
@Table(name="sys_user")
@NamedQueries({
	@NamedQuery(name=SysUser.FIND_LOGINNAME_USER,query="SELECT O FROM SysUser O where O.loginName=:loginName"),
	@NamedQuery(name=SysUser.FIND_USER_ALL,query="SELECT O FROM SysUser O")
})
public class SysUser extends AbsEntity implements IEntity {
	
	//根据用户名找到用户
	public static final String FIND_LOGINNAME_USER = "sysUser_find_loginname";
	//获取所有用户(用于用户管理)
	public static final String FIND_USER_ALL = "sysUser_find_user_all";
	@Column(length=32)
	private String loginName;
	
	@Column(length=128)
	private String password;
	
	@Column(length=32)
	private String psnCard;
	
	@Column(length=32)
	private String realName;
	
	@Column(length=64)
	private String email;
	
	@Column(length=64)
	private String tel;
	
	@Column(length=256)
	private String address;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="lastLogin")
	private Date lastLogin = new Date();

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPsnCard() {
		return psnCard;
	}

	public void setPsnCard(String psnCard) {
		this.psnCard = psnCard;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}
}
